package com.diandi.signature.service.impl.batchrun;

import com.diandi.signature.batchrun.SignatureBatchRunService;
import com.diandi.signature.bean.runbatch.SignatureBatchRunInfo;
import com.diandi.signature.manager.runbatch.SignatureBatchRunInfoManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by mxp on 2017/9/18.
 */
@Service
public class SignatureBatchRunServiceImpl implements SignatureBatchRunService {

    @Autowired
    private SignatureBatchRunInfoManager signatureBatchRunInfoManager;

    @Override
    public List<SignatureBatchRunInfo> queryTask(Integer status) {
        return signatureBatchRunInfoManager.queryTask(status);
    }

    @Override
    public Integer updateBatchRunInfo(SignatureBatchRunInfo signatureBatchRunInfo) {
        return signatureBatchRunInfoManager.updateSignatureBatchInfo(signatureBatchRunInfo);
    }

    @Override
    public Integer insertBatchRunInfo(SignatureBatchRunInfo signatureBatchRunInfo) {
        if (signatureBatchRunInfo == null){
            return 0;
        }
        return signatureBatchRunInfoManager.insertSignatureBatchRunInfo(signatureBatchRunInfo);
    }
}
